package com.qiantu.phone.ui.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.hjq.widget.layout.SettingBar;
import com.qiantu.phone.R;
import com.qiantu.phone.app.AppActivity;

public class PanelKeyBindActivity extends AppActivity {
    private SettingBar itemfirst;
    private SettingBar itemSecond;
    private SettingBar itemThird;
    private SettingBar itemFourth;
    private String controllerSerialNo;

    public static void start(Context context, String controllerSerialNo) {
        Intent intent = new Intent(context, PanelKeyBindActivity.class);
        intent.putExtra("controllerSerialNo", controllerSerialNo);
        if (!(context instanceof Activity)) {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        context.startActivity(intent);
    }
    @Override
    protected int getLayoutId() {
        return R.layout.activity_panel_key_bind;
    }

    @Override
    protected void initView() {
        controllerSerialNo = getString("controllerSerialNo");
        itemfirst = findViewById(R.id.item_first);
        itemSecond = findViewById(R.id.item_second);
        itemThird = findViewById(R.id.item_third);
        itemFourth = findViewById(R.id.item_fourth);
        setOnClickListener(R.id.item_first,R.id.item_second,R.id.item_third,R.id.item_fourth);
    }

    @Override
    protected void initData() {

    }

    @Override
    public void onClick(View view){
        int btnID = 0;
        switch (view.getId()){
            case R.id.item_first:
                btnID = 1;
                break;
            case R.id.item_second:
                btnID = 2;
                break;
            case R.id.item_third:
                btnID = 3;
                break;
            case R.id.item_fourth:
                btnID = 4;
                break;

        }
        Intent intent = new Intent(getContext(), PanelBingingActivity.class);
        intent.putExtra("panelIndex",btnID);
        intent.putExtra("panelSerialNo",controllerSerialNo);
        intent.putExtra("bingingType",1);
        startActivity(intent);
    }
}
